package com.qianji.service.impl;

import com.qianji.mapper.ActiveResultMapper;
import com.qianji.pojo.ActiveResultDto;
import com.qianji.service.ActiveResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @Author 钟丽诗
 * @Date 2021.4.15
 */
@Service
public class ActiveResultServiceImpl implements ActiveResultService {

    @Autowired
    private ActiveResultMapper activeResultMapper;

    @Override
    public Integer add(ActiveResultDto activeResultDto) {
        activeResultDto.setCreateTime(new Date());
        activeResultDto.setUpdateTime(new Date());
        return activeResultMapper.add(activeResultDto);
    }

    @Override
    public Integer update(ActiveResultDto activeResultDto) {
        activeResultDto.setUpdateTime(new Date());
        return activeResultMapper.update(activeResultDto);
    }

    @Override
    public List<ActiveResultDto> findActiveResult(ActiveResultDto activeResultDto) {
        return activeResultMapper.findActiveResult(activeResultDto);
    }
}
